Programs and Proofs Mechanizing Mathematics with Dependent Types Lecture Notes
نویسنده
چکیده
ing away from the details, we can see that nat rect is indeed a function with three parameters (the keyword fun is similar the lambda notation and is common in the family of ML-like languages). The body of nat rect is implemented as a recursive function (defined via the keyword fix) taking an argument n of type nat. Internally, it proceeds similarly to our implementation of my plus: if the argument n is zero, then the “default” value f of type P 0 is returned. Otherwise, the function proceeds recursively with a smaller argument n0 by applying the “step” function f0 to the n0 and the result of recursive call F n0. Therefore, the summing function can be implemented via the nat’s recursion combinator as follows: Definition my plus1 n m := nat rec (fun ⇒ nat) m (fun n’ m’ ⇒ m’.+1) n. Eval compute in my plus1 16 12. = 28 : (fun : nat ⇒ nat) 16 The result of invoking my plus1 is expectable. Notice, however, that when defining it we didn’t have to use the keyword Fixpoint (or, equivalently, fix), since all recursion has been “sealed” within the definition of the combinator nat rect. 2.2.1 Dependent function types and pattern matching An important thing to notice is the fact that the type of P in the definition of nat rec is a function that maps values of type nat into arbitrary types. This gives us a possibility to define dependently-typed functions, whose return type depends on their input argument value. A simple example of such a function is below:
منابع مشابه
Proof Interpretations and the Computational Content of Proofs in Mathematics
Preface These lecture notes are an extended and updated version of my BRICS Lecture Notes LS-98-1 (1998) which grew out of a BRICS PhD course which I gave in the spring term 1998. Their purpose is to give an introduction to two major proof theoretic techniques: functional interpretation and (modified) realizability. We focus on the possible use of these methods to extract programs, bounds and o...
متن کاملTypes for Proofs and Programs, International Conference, TYPES 2008, Torino, Italy, March 26-29, 2008, Revised Selected Papers
In what case do you like reading so much? What about the type of the types for proofs and programs international conference types 2008 torino italy march 26 29 2008 revised selected papers lecture notes in computer science book? The needs to read? Well, everybody has their own reason why should read some books. Mostly, it will relate to their necessity to get knowledge from the book and want to...
متن کاملAutomatic Generation of Epsilon-Delta Proofs of Continuity
As part of a project on automatic generation of proofs involving both logic and computation, we have automated the production of some proofs involving epsilon-delta arguments. These proofs involve two or three quantifiers on the logical side, and on the computational side, they involve algebra, trigonometry, and some calculus. At the border of logic and computation, they involve several types o...
متن کاملProbabilistic Proof Systems Lecture Notes
Various types of probabilistic proof systems have played a central role in the development of computer science in the last decade. In these notes, we concentrate on three such proof systems | interactive proofs, zero-knowledge proofs, and probabilistic checkable proofs. Remark: These are lecture notes in the strict sense of the word. Surveys of mine on this subject can be obtained from URL http...
متن کاملLecture Notes for Introduction to Decision Theory
12 Arrow's Impossibility Theorem 72 13 References 75 2 These are notes for a basic class in decision theory. The focus is on decision under risk and under uncertainty, with relatively little on social choice. The notes contain the mathematical material, including all the formal models and proofs that will be presented in class, but they do not contain the discussion of background, interpretatio...
متن کامل